const images = require('images'),
  log = require('../util/log');

// var dot = images(1, 1).fill(0xff, 0x00, 0x00, 0.5);
//
// var circle = images(23, 23),
//   center_x = Math.floor(circle.width() / 2),
//   center_y = Math.floor(circle.height() / 2),
//   radius = center_x < center_y ? center_x : center_y;
// for (var i = 0; i < circle.height(); i++) {
//   for (var j = 0; j < circle.width(); j++) {
//     if (Math.round(Math.sqrt((center_x - j) * (center_x - j) + (center_y - i) * (center_y - i))) == radius) {
//       circle.draw(dot, j, i)
//     }
//   }
// }

// images('D:\\Program Files\\nodejs\\private\\zoro\\zoro\\dist\\media\\20170909.JPG') //Load image from file
//   .size(400) //Geometric scaling the image to 400 pixels width
//   // .draw(circle, 0, 0) //Drawn logo
//   .save('C:\\Users\\Administrator\\Desktop\\test.JPG', { //Save the image to a file,whih quality 50
//     quality: 50
//   });

log(images('D:\\Program Files\\nodejs\\private\\zoro\\zoro\\dist\\media\\20170909.JPG').size(400).encode('jpg', {
  quality: 50
}))
